<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
	<div style="padding: 20px;">
		<div style="padding-bottom: 20px;">
			<p style="font-size: 20px">
				<strong>系统主题</strong>
			</p>
			<div style="padding: 20px;">
				系统主题：<input id="theme-combobox1" name="theme" value="默认">
			</div>
			<p style="font-size: 20px">
				<strong>系统开关</strong>
			</p>
			<div style="padding: 20px;">
				省：<input id="province-combobox" name="province" value="江苏省">&nbsp;
				市：<input id="city-combobox" name="city" value="苏州市">&nbsp;
				<button style="border-radius: 9px;" onClick="swith()">开/关</button>
				<br>
				<p style="color: #ff0000; font-size: 15px;">
					<label>江苏省苏州市&nbsp;<strong>已打开</strong>！
					</label>
				</p>
			</div>
		</div>
	</div>

	<!-- 引入自定义js文件 -->
	<script type="text/javascript">
		//主题下拉框
		$('#theme-combobox1').combobox({
			url : 'Data/theme.json',
			valueField : 'id',
			textField : 'text',
			onSelect : function(record) {
				$('#link').attr('href', record.attributes.url);
			}
		});
		var b;
		//省
		$('#province-combobox').combobox({
			url : 'Data/province.json',
			valueField : 'id',
			textField : 'text',
			onChange : function(n, o) {
				b = true;
				change(b);
			}
		});
		//市
		$('#city-combobox').combobox({
			url : 'Data/city.json',
			valueField : 'id',
			textField : 'text',
			onChange : function(n, o) {
				b = true;
				change(b);
			}
		});
		function change(b) {
			//获取数据库标识a&&b
			if (b) {
				$('p label').html(
						$('#province-combobox').combobox('getText')
								+ $('#city-combobox').combobox('getText')
								+ '&nbsp;<strong>已打开！</strong>');
				b = false;
			} else {
				$('p label').html(
						$('#province-combobox').combobox('getText')
								+ $('#city-combobox').combobox('getText')
								+ '&nbsp;<strong>已关闭！</strong>');
			}
		}
		//开关函数
		function swith() {
			if (b) {
				$('p label').html(
						$('#province-combobox').combobox('getText')
								+ $('#city-combobox').combobox('getText')
								+ '&nbsp;<strong>已打开！</strong>');
				//a = true;
				b = false;
			} else {
				$('p label').html(
						$('#province-combobox').combobox('getText')
								+ $('#city-combobox').combobox('getText')
								+ '&nbsp;<strong>已关闭！</strong>');
				//a = false;
				b = true;
			}
		}
	</script>
</body>
</html>